package com.mairuide.one_click_search.controller;

import com.mairuide.entity.Result;
import com.mairuide.entity.StatusCode;
import com.mairuide.one_click_search.dto.DataTemplateDto;
import com.mairuide.one_click_search.service.DataTemplateFieldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Description
 * @auther 刘中华
 * @create 2019-04-28 17:12
 */
@Controller
@RequestMapping("onekey_filed")
public class DataTemplateFieldController {
    @Autowired
    private DataTemplateFieldService dataTemplateFieldService;

    @RequestMapping("/add")
    @ResponseBody
    public Result addFiled(@RequestBody DataTemplateDto dataTemplateDto){
        dataTemplateFieldService.addTemplateField(dataTemplateDto);
        return new Result(true, StatusCode.OK,"操作成功");
    }
}
